#pragma once

#include <strstream>
#include <string>
#include "SDLSprite.h"
#include "SDLAnimation.h"
#include "ScreenMenu.h"

class Character : public SDLAnimation
{
public:
	enum Stats { HP, MP, STR, INT, COUNT };
	enum Anim {IDLE, WALKF, WALKB, WALKR, WALKL, HEADF, DEAD, MUSIC, SQUAT, BYE, ATTACK, CAST, ACOUNT};
protected:
	SDLAnimation* characterAnim[ACOUNT];
	SDLAnimation* currentAnim;

	std::string name;
	std::string side;

	std::vector<std::string> spells;

	int stats[COUNT];
	int maxStats[MP + 1];
	bool isAlive;
	std::string id;

	std::vector<std::string> sort0;
	ScreenMenu* spellMenu;
public:
	Character();
	Character(std::string name, std::string side, std::string id);
	~Character();

	virtual void Draw(){  };

	int GetStats(Stats stat) { return stats[stat]; }
	int* GetStatsRef(Stats stat) { return &stats[stat]; }
	int GetMaxStats(Stats stat) { return maxStats[stat]; }
	std::string GetName() { return name; }
	std::string GetSide() { return side; }
	//ScreenMenu* GetSpells(int sort = 0);
	bool IsAlive() { return isAlive; }

	void HealHP(int value);
	void HealMP(int value);
	void Damage(int value);
	bool Revive(int percent);
};

